
import { checkNameForm } from "./formRuler";

// isBoolean:true, // 是否为Boolean类型, 参数是否必须为boolen类型，不是根据options个数判断，是根据后台字段类型要求判断
const itemForm = [
  {
    value: '',
    type: 'topTimeSettings',
    id: '',
    children: [
      {
        value: '定时置顶',
        placeholder: '请输入',
        param: 'label',
        rule: {
          required: true,
          //validator: checkNameForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '组件标题不能重复!',
          api: "fetchOssNameUnique",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "组件标题:",
        beforeText: '',
        afterText: '',
        width: '',
        showCount: false,
        disabled: true,
        marginLeft: 0,
        marginTop: 0,
        type: 'textInput',
        associated: '',
        associatedValue: '',
      },
      {
        value: 'nlineTime',
        placeholder: '请输入',
        param: 'tag',
        rule: {
          required: true,
          //validator: checkNameForm,
          trigger: ["blur"],
          message: '组件标签必填!',
          api: "fetchOssNameUnique",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "组件标签:",
        beforeText: '',
        afterText: '',
        width: '',
        showCount: false,
        disabled: true,
        marginLeft: 0,
        marginTop: 0,
        type: 'textInput',
        associated: '',
        associatedValue: '',
      },
      {
        value: '',
        placeholder: '请输入',
        param: 'helpMsg',
        rule: {
          required: false,
          //validator: checkNameForm,
          trigger: ["blur"],
          msg1: '1111',
          msg2: '帮助信息不能重复!',
          api: "fetchOssNameUnique",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "帮助信息:",
        beforeText: '',
        afterText: '',
        width: '',
        showCount: false,
        disable: true,
        marginLeft: 0,
        marginTop: 0,
        type: 'textInput',
        associated: '',
        associatedValue: '',
      },
      {
        value: '3',
        placeholder: '请选择',
        param: 'dateType',
        rule: {
          required: false,
          //validator: checkNameForm,
          trigger: [""],
          message: '储存类型不能为空',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "类型:",
        beforeText: '',
        afterText: '',
        width: '',
        marginLeft: 0,
        disabled: true,
        type: 'multipleSelect',
        options: [
          { label: '日期', value: '1' },
          { label: '时间', value: '2' },
          { label: '日期+时间', value: '3' },

        ],
        mode: 'single',
        associated: '',
        associatedValue: '',
      },
      {
        value: 'YYYY-MM-DD',
        placeholder: '请选择',
        param: 'time_half_b1',
        rule: {
          required: false,
          //validator: checkNameForm,
          trigger: [""],
          message: '储存类型不能为空',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "时间精确到:",
        beforeText: '',
        afterText: '',
        width: '',
        disabled: true,
        marginLeft: 0,
        type: 'multipleSelect',
        options: [
          { label: '仅年', value: 'YYYY' },
          { label: '仅月', value: 'MM' },
          { label: '仅日', value: 'DD' },
          { label: '年-月', value: 'YYYY-MM' },
          { label: '月-日', value: 'MM-DD' },
          { label: '年-月-日', value: 'YYYY-MM-DD' },

        ],
        mode: 'single',
        associated: 'dateType',
        associatedValue: '1',
      },
      {
        value: 'YYYY-MM-DD',
        placeholder: '请选择',
        param: 'time_half_b2',
        rule: {
          required: false,
          //validator: checkNameForm,
          trigger: [""],
          message: '储存类型不能为空',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "日期精确到:",
        beforeText: '',
        afterText: '',
        width: '',
        disabled: true,
        marginLeft: 0,
        type: 'multipleSelect',
        options: [
          { label: '仅日', value: 'DD' },
          { label: '月-日', value: 'MM-DD' },
          { label: '年-月-日', value: 'YYYY-MM-DD' },
        ],
        mode: 'single',
        associated: 'dateType',
        associatedValue: '3',
      },
      {
        value: 'HH:mm:ss',
        placeholder: '请选择',
        param: 'timetime_half_a',
        rule: {
          required: false,
          //validator: checkNameForm,
          trigger: [""],
          message: '储存类型不能为空',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "时间精确到:",
        beforeText: '',
        afterText: '',
        width: '',
        disabled: true,
        marginLeft: 0,
        type: 'multipleSelect',
        options: [
          { label: '时', value: 'HH' },
          { label: '分', value: 'HH:mm' },
          { label: '秒', value: 'HH:mm:ss' },
        ],
        mode: 'single',
        associated: 'dateType',
        associatedValue: '!=1',
      },
      {
        value: false,
        param: 'rule',
        rule: {
          required: false,
          //validator: checkCreatSiteForm,
          trigger: ["blur"],
          msg1: '',
          msg2: '',
          api: "",
          key: 'siteDomain',
          params: {}, //校验传参
        },
        label: "是否必填:",
        marginLeft: 0,
        type: 'radio',
        isBoolean: true, // 是否为Boolean类型
        options: ['是', '否'],
        tips: '',
      },
    ]
  },
]
export { itemForm }